package m3d31;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

//反序列化流   把文件的对象以流的方式取出来
public class qObjectInputStream {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("day02\\src\\m3d31\\m.txt"));

        //反序列化的前提 类有标记  存在类对应的class文件（没有就抛出异常）
        Object o = ois.readObject();

        ois.close();
        System.out.println(o);
        pPerson p = (pPerson) o;
        System.out.println(p);
    }
}
